package com.lm.ledger.service;

import java.util.List;

import com.lm.ledger.dao.LedgerDao;
import com.lm.ledger.dao.LedgerDaoImp;
import com.lm.ledger.exception.LedgerException;
import com.lm.ledger.utill.Account;
import com.lm.ledger.utill.User;

public class TransactionServiceImp implements TransactionService{

	private LedgerDao dao;
	
	public TransactionServiceImp(){
		dao = new LedgerDaoImp();
	}

	public void saveNewTrx(Account acc) {
		dao.saveNewTrx(acc);		
	}

	public void updateTrx(Account account) {
		dao.updateTrx(account);
	}

	public List searchList(Account acc, Double userId, String from) {		
		return dao.searchList(acc, userId, from);
	}

	public Account getAccountForFormId(String formId) {		
		return dao.getAccountForFormId(formId);
	}

	public List getAllTrxs(Double userId) {
		return dao.getAllTrxs(userId);
	}

	public List searchApproveTrx(Double userId) {
		return dao.searchApproveTrx(userId);
	}

	public void approveTrx(Account account) {
		dao.approveTrx(account);
	}

	public List getLocations(Double userId) {
		return dao.getLocations(userId);
	}

	public User userDetail(String name) {
		return dao.userDetail(name);
	}

	public void rejectTrx(String formId) {
		dao.rejectTrx(formId);
	}

	public List searchAllUserTrx(Double userId){
		return dao.searchAllUserTrx(userId);
	}
}
